package com.itheima.overload;

public class MethodTest2 {
    public static void main(String[] args) {
        // 目标：掌握方法重载的应用场景。
        fire();
        fire("小日子");
        fire("米国", 999);
    }

/*
    public static void fire(){
        System.out.println("默认给岛国发射一枚武器");
    }

    public static void fire(String country){
        System.out.println("发射了一枚武器给岛国"+country);
    }

    public static void fire(String country,int number){
        System.out.println("发射了"+number+"个武器给"+country);
    }
*/

    //简化上述的方法重载案例
    public static void fire(){
        fire("岛国");
    }

    public static void fire(String country){
        fire(country,1);
    }

    private static void fire(String country, int number) {
        System.out.println("发射了"+number+"个武器给"+country);
    }

}
